/* Stili generali */
body {
    font-family: 'Open Sans', sans-serif;
    color: #333;
    line-height: 1.6;
    background-color: #ffffff;
}

.block_box_center {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 5px;
}

.leo-title {
    font-size: 28px;
    color: #317cad;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.title_block {
    font-size: 22px;
    color: #317cad;
    margin: 15px 0;
}

h5 {
    font-size: 18px;
    color: #333;
    margin: 15px 0;
}

p {
    margin-bottom: 15px;
}

/* Form styling */
fieldset {
    border: 1px solid #ddd;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    background-color: #fafafa;
}

legend {
    font-size: 16px;
    font-weight: bold;
    padding: 0 10px;
    color: #317cad;
    width: auto;
    border: none;
    margin-bottom: 0;
}

.form-control {
    display: block;
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    line-height: 1.42857143;
    color: #555;
    background-color: #fff;
    background-image: none;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
    transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
}

.form-control:focus {
    border-color: #317cad;
    outline: 0;
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(49, 124, 173, 0.6);
}

/* Tabelle generiche a 4 colonne (per i dati personali) */
.table {
    width: 100%;
    max-width: 100%;
    margin-bottom: 20px;
    border-collapse: collapse;
}

.table > tbody > tr > td {
    padding: 8px;
    vertical-align: top;
}

/* Fix per le tabelle dei dati personali a 4 colonne */
fieldset:not(:nth-of-type(5)) .table td:nth-child(1),
fieldset:not(:nth-of-type(5)) .table td:nth-child(3) {
    width: 20%;
    white-space: nowrap;
}

fieldset:not(:nth-of-type(5)) .table td:nth-child(2),
fieldset:not(:nth-of-type(5)) .table td:nth-child(4) {
    width: 30%;
}

/* Stili specifici per la tabella dei dati prodotto */
#datProd {
    width: 100%;
    table-layout: fixed; /* Manteniamo fixed per controllare meglio le larghezze */
    border-collapse: collapse;
}

/* Formattazione dell'header della tabella prodotti */
#datProd tr:first-child {
    background-color: #f2f2f2;
    font-weight: bold;
}

#datProd tr:first-child td {
    vertical-align: middle;
    font-size: 13px; /* Riduco leggermente il font nell'header */
    height: auto;
    padding: 6px 3px; /* Padding più compatto */
}

/* Distribuiamo meglio le larghezze delle colonne */
#datProd td:nth-child(1) { /* Colonna plus/minus */
    width: 3%;
}

#datProd td:nth-child(2) { /* Tipologia */
    width: 12%;
}

#datProd td:nth-child(3) { /* Codice articolo */
    width: 12%;
}

#datProd td:nth-child(4) { /* Quantità */
    width: 8%;
}

#datProd td:nth-child(5) { /* Serial Number */
    width: 22%;
}

#datProd td:nth-child(6) { /* N° DDT */
    width: 18%;
}

#datProd td:nth-child(7) { /* Data DDT */
    width: 15%;
}

/* Stile generale per le celle della tabella prodotti */
#datProd td {
    padding: 6px;
    vertical-align: middle;
    border: 1px solid #ddd;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Stile per input nelle celle della tabella prodotti */
#datProd input,
#datProd select,
#datProd textarea {
    width: 100%;
    box-sizing: border-box;
    font-size: 13px; /* Leggermente più piccolo per risparmiare spazio */
    padding: 5px;
}

/* Riga di descrizione difetto */
#datProd tr.rowDisp:nth-of-type(2) td {
    vertical-align: top;
}

#datProd tr.rowDisp:nth-of-type(2) td:first-child {
    width: 20%;
}

#datProd tr.rowDisp:nth-of-type(2) td:last-child {
    width: 80%;
}

.textareaRows {
    min-height: 100px;
    resize: vertical;
}

/* Buttons and icons */
input[type="submit"] {
    display: inline-block;
    background-color: #317cad;
    color: white;
    padding: 10px 20px;
    font-weight: bold;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-transform: uppercase;
    margin-top: 15px;
    transition: background-color 0.3s ease;
}

input[type="submit"]:hover {
    background-color: #266085;
}

.addRow {
    cursor: pointer;
    width: 20px;
    height: 20px;
}

/* Alert and notice boxes */
.att {
    color: #d9534f;
    font-weight: bold;
    font-size: 16px;
}

.pd10 {
    padding: 10px;
}

.tohide {
    display: none;
}

.alertAlim {
    background-color: #fcf8e3;
    border: 1px solid #faebcc;
    color: #8a6d3b;
    padding: 15px;
    margin-top: 10px;
    border-radius: 4px;
}

/* Loading indicator */
.loading_frame {
    display: none; /* Hide by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 1000;
    text-align: center;
}

/* Override per larghezze personalizzate */
input[style*="width:40%"] {
    width: 40% !important;
}

input[style*="width:70%"] {
    width: 70% !important;
}

/* Checkbox styling */
input[type="checkbox"] {
    margin-right: 5px;
}

/* Colors matching the website */
.text-primary {
    color: #317cad;
}

.bg-primary {
    background-color: #317cad;
    color: white;
}

/* Stili specifici per gli input della tabella prodotti */
.inputRMA {
    padding: 5px;
    width: 100%;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Gestisci il layout verticale per le tabelle dei dati personali su schermi piccoli */
    fieldset:not(:nth-of-type(5)) .table td {
        display: block;
        width: 100% !important;
        clear: both;
    }
    
    fieldset:not(:nth-of-type(5)) .table td:nth-child(odd) {
        font-weight: bold;
        margin-top: 10px;
        padding-bottom: 0;
    }
    
    fieldset:not(:nth-of-type(5)) .table td:nth-child(even) {
        padding-top: 5px;
        margin-bottom: 10px;
    }
    
    /* Resetta le larghezze personalizzate */
    input[style*="width"] {
        width: 100% !important;
    }
}

/* Stile per la tabella prodotti su schermi molto piccoli */
@media (max-width: 768px) {
    #datProd {
        display: block;
        overflow-x: auto;
        table-layout: auto; /* Su mobile, lasciamo che la tabella si adatti naturalmente */
    }
    
    /* Rimuovo le larghezze fisse su mobile */
    #datProd td {
        width: auto !important;
    }
}

/* Migliora il layout delle righe della descrizione difetto */
#datProd tr.rowDisp:nth-of-type(2) td:first-child {
    width: 25%;
    padding-right: 15px;
    vertical-align: top;
    font-size: 13px;
    line-height: 1.4;
}

#datProd tr.rowDisp:nth-of-type(2) td:last-child {
    width: 75%;
    padding-left: 10px;
}

/* Migliora lo stile della descrizione difetto per evitare sovrapposizioni */
#datProd td[colspan="2"] {
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}


/* Migliora il layout delle righe della descrizione difetto */
#datProd tr.rowDisp:nth-of-type(2) td:first-child {
    width: 25%;
    padding-right: 15px;
    vertical-align: middle;
    font-size: 13px;
    line-height: 1.4;
}

#datProd tr.rowDisp:nth-of-type(2) td:last-child {
    width: 75%;
    padding-left: 10px;
}

/* Migliora lo stile della descrizione difetto per evitare sovrapposizioni */
#datProd td[colspan="2"] {
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

/* Migliora il layout della tabella prodotti per i dispositivi mobili */
@media (max-width: 768px) {
    #datProd tr.rowDisp:nth-of-type(2) td:first-child,
    #datProd tr.rowDisp:nth-of-type(2) td:last-child {
        display: block;
        width: 100%;
        padding: 8px;
    }
    
    #datProd tr.rowDisp:nth-of-type(2) td:first-child {
        font-weight: bold;
        background-color: #f5f5f5;
        border-bottom: none;
    }
}

.otherFields1 .table td:first-child {
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    color: #333;
    font-weight: normal;
    line-height: 1.6;
    padding: 8px;
    vertical-align: top;
}

/* Stile per il container del logo */
.logo-container {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

/* Stile per l'immagine del logo */
.header-logo {
    max-width: 300px; /* Imposta la larghezza massima secondo le tue necessità */
    height: auto;
    display: inline-block;
}

/* Stile responsive per schermi più piccoli */
@media (max-width: 768px) {
    .header-logo {
        max-width: 80%; /* Su schermi piccoli l'immagine si adatta alla larghezza */
    }
}
